{% extends "base.html" %}
  {% block content %}
        <div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <h2 class="page-header">Minions Asset Info</h2>
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
            <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            Minions Asset Info
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <div class="dataTable_wrapper">
                                <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                                    <thead>
                                        <tr>
                                            <th>Minions</th>
                                            <th>Release</th>
                                            <th>Info</th>
                                        </tr>
                                    </thead>
                                    <!---
                                    <tbody>
                                        {% for key in jyp %}
                                        <tr class="odd gradeX">
                                            <td>{{ key.id }}</td>
                                            <td>
                                                <li style="list-style-type:none">
                                                       {{ key.osfullname }}-{{ key.osrelease }}
                                                </li>
                                                <li style="list-style-type:none">
                                                       {{ key.kernelrelease }}
                                                </li>
                                            </td>
                                            <td>
                                                  {% for inter,ip_list in key.ip4_interfaces.items %}
                                                  <li style="list-style-type:none">
                                                       {% for ip in ip_list %}
                                                           {{ inter }}:{{ ip }}
                                                       {% endfor %}
                                                  </li>
                                                  {% endfor %}
                                            </td>
                                            <td>{{ key.mem_total }} MB</td>
                                            <td>{{ key.num_cpus }} Cores</td>
                                            <td>
                                                {% for volume , used in key.disk.items %}
                                                  <li style="list-style-type:none">
                                                      <div style="height:28px">
                                                           <strong> {{ volume }}</strong>
                                                           <span class="pull-right text-muted">{{ used }}%</span>
                                                           <div class="progress progress-striped active" style="height:8px" style="margin-bottom:0px">
                                                               {% if used >= 60 %}
                                                                <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: {{ used }}%">
                                                                </div>
                                                               {% else %}
                                                                <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: {{ used }}%">
                                                                </div>
                                                               {% endif %}
                                                           </div>
                                                      </div>
                                                  </li>
                                                {% endfor %}
                                            </td>
                                        </tr>
                                    {% endfor %}
                                    </tbody>
                                    -->
                                <tbody>
                                    {% for asset_info in asset %}
                                        {% for minion_id,grains in asset_info.items %}
                                            <tr class="odd gradeX">
                                                <td>{{ minion_id }}</td>
                                                <td>
                                                    <li style="list-style-type:none">
                                                          <span style="color: #009900">Release: </span>{{ grains.osfullname }}-{{ grains.osrelease }}
                                                    </li>
                                                    <li style="list-style-type:none">
                                                          <span style="color: #009900">Kernel: </span>{{ grains.kernelrelease }}
                                                    </li>
                                                </td>
                                                <td>
                                                    <li style="list-style-type:none">
                                                          <span style="color: #009900">Cores: </span>{{ grains.num_cpus }}
                                                    </li>
                                                    <li style="list-style-type:none">
                                                          <span style="color: #009900">Mem: </span>{{ grains.mem_total }} MB
                                                    </li>
                                                    <li style="list-style-type:none">
                                                          <span style="color: #009900">Model: </span>{{ grains.cpu_model }}
                                                    </li>
                                                    {% for inter,ip_list in grains.ip4_interfaces.items %}
                                                        <li style="list-style-type:none">
                                                           {% for ip in ip_list %}
                                                               {% if inter = 'lo' %}
                                                                  <span style="color: #009900; display: none">{{ inter }}: {{ ip }}</span>
                                                               {% else %}
                                                                  <span style="color: #009900">{{ inter|capfirst }}: </span>{{ ip }}
                                                               {% endif %}
                                                           {% endfor %}
                                                        </li>
                                                    {% endfor %}
                                                     <li style="list-style-type:none">
                                                           <span style="color: #009900">Manufacturer: </span>{{grains.manufacturer}}
                                                    </li>
                                                    <li style="list-style-type:none">
                                                           <span style="color: #009900">Product: </span>{{ grains.productname }}
                                                    </li>
                                                    <li style="list-style-type:none">
                                                           <span style="color: #009900">SN: </span>{{ grains.serialnumber }}
                                                    </li>
                                                    <li style="list-style-type:none">
                                                           <span style="color: #009900">Server_ID: </span>{{ grains.server_id }}
                                                    </li>
                                                </td>
                                            </tr>
                                        {% endfor %}
                                    {% endfor %}
                                    </tbody>
                                </table>
                            </div>
                            <!-- /.table-responsive -->                  
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
        </div>
        <!-- /#page-wrapper -->
  {% endblock %}